package fr.cephb.locustree.svg;

import fr.cephb.locustree.DefaultURLCreator;
import fr.cephb.locustree.URLCreator;


public class DefaultTrackHandler implements TrackHandler
	{
	private EntityPainter entityPainter=null;
	private HistogramPainter histogramPainter=null;
	private Packer packer=null;
	private URLCreator urlCreator=null;
	public DefaultTrackHandler()
		{
		
		}
	
	public void setEntityPainter(EntityPainter entityPainter)
		{
		this.entityPainter = entityPainter;
		}
	
	@Override
	public EntityPainter getEntityPainter()
		{
		if(this.entityPainter==null) this.entityPainter=new DefaultEntityPainter();
		return entityPainter;
		}

	public void setHistogramPainter(HistogramPainter histogramPainter)
		{
		this.histogramPainter = histogramPainter;
		}
	
	@Override
	public HistogramPainter getHistogramPainter()
		{
		if(this.histogramPainter==null) this.histogramPainter=new DefaultHistogramPainter();
		return histogramPainter;
		}
	
	@Override
	public Packer getPacker()
		{
		if(this.packer==null) this.packer=new DefaultPacker();
		return packer;
		}
	public void setPacker(Packer packer)
		{
		this.packer = packer;
		}
	
	public void setUrlCreator(URLCreator urlCreator)
		{
		this.urlCreator = urlCreator;
		}
	
	@Override
	public URLCreator getUrlCreator()
		{
		if(this.urlCreator==null) this.urlCreator=new DefaultURLCreator();
		return urlCreator;
		}
	
	@Override
	public int hashCode()
		{
		return 1;
		}
	
	@Override
	public boolean equals(Object object)
		{
		return object==this;
		}
	
	@Override
	public String toString()
		{
		return getClass().getCanonicalName();
		}
	}
